<template>
	<view>
		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">客户信息</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>客户类型</text>
					<text style="color: #333;">{{customerInfo.memberType|customerType}}</text>
				</view>
				<view class="textItem">
					<text>客户来源</text>
					<text style="color: #333;">{{customerInfo.memberSource|memberSource}}</text>
				</view>

				<!-- 个人 -->
				<block v-if="customerInfo.memberType == 2">
					<view class="textItem">
						<text>客户名称</text>
						<text style="color: #333;">{{customerInfo.memberName|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>联系电话</text>
						<text style="color: #333;">{{customerInfo.contactPhone|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>联系地址</text>
						<text style="color: #333;">{{customerInfo.contactAddress| filterNull}}</text>
					</view>
				</block>
				<!-- 企业 -->
				<block v-else>
					<view class="textItem">
						<text>企业名称</text>
						<text style="color: #333;">{{customerInfo.enterpriseName|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>统一社会信用代码</text>
						<text style="color: #333;">{{customerInfo.creditCode|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>企业地址</text>
						<text style="color: #333;">{{customerInfo.enterpriseAdderss|filterNull}}</text>
					</view>
					<view class="textItem" style="flex-direction: column;align-items: flex-start;">
						<text style="margin-bottom: 16rpx;">营业执照</text>
						<u-album v-if="url0.length > 0" :urls="url0" singleSize="158">
						</u-album>
					</view>
					<view class="textItem">
						<text>企业联系人</text>
						<text style="color: #333;">{{customerInfo.memberName|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>联系电话</text>
						<text style="color: #333;">{{customerInfo.contactPhone|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>联系地址</text>
						<text style="color: #333;">{{customerInfo.contactAddress | filterNull}}</text>
					</view>

				</block>
			</view>
		</view>

		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">身份信息</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>证件类型</text>
					<text style="color: #333;">{{customerInfo.documentType|documentType}}</text>
				</view>
				<view class="textItem">
					<text>证件号码</text>
					<text style="color: #333;">{{customerInfo.cardId|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>失效日期</text>
					<text style="color: #333;">{{customerInfo.cardValidity|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">身份证照片</text>
					<view class="flex-row-center-sb">
						<view style="margin-right: 30rpx;">
							<u-album v-if="url1.length>0" :urls="url1" singleSize="158">
							</u-album>
						</view>
						<view>
							<u-album v-if="url2.length>0" :urls="url2" singleSize="158">
							</u-album>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">驾驶证信息</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>驾驶证类型</text>
					<text style="color: #333;">{{customerInfo.drivingType|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>失效日期</text>
					<text style="color: #333;">{{customerInfo.drivingValidity|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">驾驶证照片</text>
					<view class="flex-row-center-sb">
						<view style="margin-right: 30rpx;">
							<u-album v-if="url3.length>0" :urls="url3" singleSize="158">
							</u-album>
						</view>
						<view>
							<u-album v-if="url4.length>0" :urls="url4" singleSize="158">
							</u-album>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">其他说明</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>备注</text>
					<text style="color: #333;">{{customerInfo.remark | filterNull}}</text>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import * as customerApi from '@/api/cutomer-api.js'
	import settings from '@/settings.js'
	export default {
		data() {
			return {
				url0: [],
				url1: [],
				url2: [],
				url3: [],
				url4: [],
				customerInfo : {},
				memberNo : '',
				
			}
		},
		onLoad(op) {
          this.memberNo = op.memberNo;
		  this.getMemberDetail();
		},
		methods: {
            getMemberDetail() {
				customerApi.memberDetail(this.memberNo).then(res=>{
					this.customerInfo = res.data;
					if(!this.$u.test.isEmpty(this.customerInfo.businessLicenseUrl)) {
						let ur0 = settings.baseImageUrl + this.customerInfo.businessLicenseUrl;
						this.url0.push(url);
					}
					if(!this.$u.test.isEmpty(this.customerInfo.idCardUrl)) {
						let url = settings.baseImageUrl + this.customerInfo.idCardUrl;
						this.url1.push(url);
					}
					if(!this.$u.test.isEmpty(this.customerInfo.idCardBackUrl)) {
						let url = settings.baseImageUrl + this.customerInfo.idCardBackUrl;
						this.url2.push(url);
					}
					if(!this.$u.test.isEmpty(this.customerInfo.driverUrl)) {
						let url = settings.baseImageUrl + this.customerInfo.driverUrl;
						this.url3.push(url);
					}
					if(!this.$u.test.isEmpty(this.customerInfo.driverBackUrl)) {
						let url = settings.baseImageUrl + this.customerInfo.driverBackUrl;
						this.url4.push(url);
					}
				   
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
